package cn.newtest.common.exception;

/*******************************************************************************
 * <p>
 * Title:
 * </p>
 * <p>
 * Description: it is application exception.
 * </p>
 * <p>
 * Copyright: Copyright (c) 2003 .01
 * </p>
 * <p>
 * Company: risesoft
 * </p>
 * 
 * @author eagle (hjqlx@163.net)
 * @version 1.0
 */

public class ApplicationException extends Exception {
	/**
	 * 
	 */
	private static final long serialVersionUID = -4829868533455699956L;
	private String msg = null;
	private String javaMethod = null;
	private Exception error = null;
	private int errorCode = 0;
	public final static int DUP_KEY = 1;

	public ApplicationException() {
		super();
	}

	/*
	 * public ApplicationException(Exception ex) { super(ex); }
	 */

	public ApplicationException(String msg) {
		this.msg = msg;
	}

	public ApplicationException(String msg, int errorCode) {
		this.msg = msg;
		this.errorCode = errorCode;
	}

	public ApplicationException(String msg, Exception ex) {
		this.msg = msg;
		this.error = ex;
	}

	public ApplicationException(String msg, String javaMethod, Exception ex) {
		this.msg = msg;
		this.error = ex;
		this.javaMethod = javaMethod;
	}

	public String getMessage() {
		return this.msg;
	}

	public String getErrorSourc() {
		return this.javaMethod;
	}

	public Exception getSysError() {
		return this.error;
	}

	public int getErrorCode() {
		return this.errorCode;
	}
}